package com.manlu.mapper;

import com.manlu.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@org.apache.ibatis.annotations.Mapper
public interface UserMapper extends Mapper<User> {
    /**
     * 根据状态查询用户列表
     *
     * @param state 状态
     * @return
     */
    @Select("select * from wx_user where state = #{state} ")
    List<User> selectAllByState(@Param("state") Integer state);

    /**
     * 根据用户id修改用户的状态
     *
     * @param uid   用户id
     * @param state 状态
     * @return
     */
    @Update("update wx_user set state = #{state} where uid = #{uid}")
    int editUserState(@Param("uid") Integer uid, @Param("state") Integer state);
}
